package com.boot.common.modules.exception;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @GetMapping("/")
    public String index() {
        return  "index";
    }

    @GetMapping("/test/exception")
    public String testException() {
        throw  new RuntimeException("抛异常");
    }



//    @ExceptionHandler(Exception.class)
//    public R handleException(Exception e){
//        logger.error("局部异常，只作用该类:" +  e.getMessage(), e);
//        return R.error();
//    }


}
